package com.example.neteasecloudmusic_kotlin.ui

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.neteasecloudmusic_kotlin.MainActivity
import com.example.neteasecloudmusic_kotlin.ui.boke.BokeFragment
import com.example.neteasecloudmusic_kotlin.ui.cloudhometown.CloudHomeTownFragment
import com.example.neteasecloudmusic_kotlin.ui.follow.FollowFragment
import com.example.neteasecloudmusic_kotlin.ui.homepage.DiscoverFragment
import com.example.neteasecloudmusic_kotlin.ui.mine.MineFragment

class FragmentAdapter(fragment: MainActivity) : FragmentStateAdapter(fragment) {
    override fun getItemCount() = 5

    override fun createFragment(position: Int): Fragment {
        when (position) {
            0 -> return DiscoverFragment()
            1 -> return BokeFragment()
            2 -> return MineFragment()
            3 -> return FollowFragment()
            4 -> return CloudHomeTownFragment()
        }
        return DiscoverFragment()
    }
}